home *** CD-ROM | disk | FTP | other *** search
/ Greenhouse Effect Detection Expriment / NASA Greenhouse Effect Detection Expriment 1992 - Disc 2.iso / software / dos / cdf22pc / src / tools / elemsize.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-24  |  1020 b   |  40 lines

  1. /******************************************************************************
  2. *
  3. *  NSSDC/CDF            Return size (in bytes) of a data type element.
  4. *
  5. *  Version 1.0, 25-Feb-92, Hughes STX
  6. *
  7. *  Modification history:
  8. *
  9. *   V1.0  25-Feb-92, J Love       Original version.
  10. *
  11. ******************************************************************************/
  12.  
  13. #include "cdfdist.h"
  14.  
  15. /******************************************************************************
  16. * ElemSize.
  17. ******************************************************************************/
  18.  
  19. int ElemSize(dataType)
  20. long dataType;
  21. {
  22. switch (dataType) {
  23.   case CDF_BYTE:   return 1;
  24.   case CDF_INT1:   return 1;
  25.   case CDF_INT2:   return 2;
  26.   case CDF_INT4:   return 4;
  27.   case CDF_UINT1:  return 1;
  28.   case CDF_UINT2:  return 2;
  29.   case CDF_UINT4:  return 4;
  30.   case CDF_REAL4:  return 4;
  31.   case CDF_REAL8:  return 8;
  32.   case CDF_FLOAT:  return 4;
  33.   case CDF_DOUBLE: return 8;
  34.   case CDF_EPOCH:  return 8;
  35.   case CDF_CHAR:   return 1;
  36.   case CDF_UCHAR:  return 1;
  37. }
  38. return 0;
  39. }
  40.